<template>
	<div>
		<div class="banner" @click="handleBannerClick">
			<img :src="this.bannerImg" class="banner-img">
			<div class="banner-info">
				<div class="banner-desc">
					{{this.sightName}}
				</div>
				<div class="img-num">
					<span class="iconfont">&#xe70c;</span>
					{{this.gallaryImgs.length}}
				</div>
			</div>
		</div>
		<FadeAnimation>
		<common-gallery :imgs="this.gallaryImgs" 
						v-show="showgallary"
						@close="handleCloseClick"></common-gallery>
		</FadeAnimation>
	</div>
</template>

<script>
import CommonGallery from 'common/gallary/Gallary'
import FadeAnimation from 'common/fade/FadeAnimation'
export default{
	name: 'DetailBanner',
	props:{
		sightName:String,
		bannerImg:String,
		gallaryImgs:Array
	},
	components:{
		CommonGallery,
		FadeAnimation
	},
	data:function(){
		return{
			showgallary:false
		}
	},
	methods:{
		handleBannerClick:function(){
			this.showgallary = true
		},
		handleCloseClick:function(){
			this.showgallary = false
		}
	}
}
</script>

<style lang="stylus" scoped>
	.banner
		position:relative
		overflow:hidden
		height:0
		padding-bottom: 55%
		.banner-img
			width: 100%
		.banner-info
			bottom: 0
			left: 0
			right: 0
			position: absolute
			display: flex
			line-height: .6rem
			background-image: linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.8))
			color: #fff
			.banner-desc
				flex: 1
			.img-num
				padding: 0 .4rem
				margin-top: .2rem
				height: .32rem
				line-height: .32rem
				border-radius: .2rem
				background: rgba(0,0,0, .8)
				font-size: .24rem
</style>
